#ifndef BUTTONGROUP_H
#define BUTTONGROUP_H

#include <QObject>
#include <QButtonGroup>

class ButtonGroup : public QObject
{
    Q_OBJECT
public:
    ButtonGroup(QObject *parent = nullptr);
    ~ButtonGroup();


    void addButton(QAbstractButton *button);
    void removeButton(QAbstractButton *button);

protected Q_SLOTS:
    void ButtonToggled(bool checked);
private:
    void Init();

private:
    QButtonGroup m_buttonGroup;
    QAbstractButton* m_pToggledButton;
    QList<QAbstractButton*> m_buttons;
};

#endif // BUTTONGROUP_H
